package lab02.test02;

import java.util.Scanner;

public class Circle {
    //	2、 	设计一个圆形类，可以返回圆的面积与周长。
    public static void main(String[] args) {
        System.out.println("请输入R");

        Scanner sca = new Scanner(System.in);
        double r = sca.nextDouble();

        Circle c= new Circle();

        double a = c.area(r);
        double p = c.perimeter(r);
        System.out.println(a);
        System.out.println(p);

    }

    public double perimeter(double r) {
        double p = 2 * 3.14 * r;
        return p;
    }

    public double area(double r) {
        double a = 3.14 * r * r;
        return a;
    }

}

